lisp/subr.el (last): Deal with dotted lists (reported in bug#7174).
authorGlenn Morris <rgm@gnu.org>
Wed, 13 Oct 2010 23:43:39 +0000 (01:43 +0200)
committerJuanma Barranquero <lekktu@gmail.com>
Wed, 13 Oct 2010 23:43:39 +0000 (01:43 +0200)
lisp/ChangeLog
lisp/subr.el

index bed00b43055c08d0f94e9550462821a29661ee82..bd0be0bcea7ca2d405c5762c1ceedfc69ec78fb7 100644 (file)
@@ -1,3 +1,7 @@
+2010-10-13  Glenn Morris  <rgm@gnu.org>
+
+       * subr.el (last): Deal with dotted lists (reported in bug#7174).
+
 2010-10-13  Stephen Berman  <stephen.berman@gmx.net>
 
        * subr.el (last): Use `safe-length' instead of `length' (bug#7206).
index dabadec770e62ae3268b5e8615ca606885c39fed..8c42e5bd66a1dd03830a253b12dfe24889f4c6d6 100644 (file)
@@ -289,7 +289,7 @@ If LIST is nil, return nil.
 If N is non-nil, return the Nth-to-last link of LIST.
 If N is bigger than the length of LIST, return LIST."
   (if n
-      (and (> n 0)
+      (and (>= n 0)
            (let ((m (safe-length list)))
              (if (< n m) (nthcdr (- m n) list) list)))
     (and list